Preventing the "[YourProgramName] has stopped working" dialog on unhandled exceptions.

Posted by Serapth on Stack Overflow See other posts from Stack Overflow or by Serapth
Published on 2010-04-29T14:49:14Z Indexed on 2010/05/01 19:37 UTC
Read the original article Hit count: 143

Filed under:
|
|

I have a WinForm application, with some dependencies on an external library that can on occasion cause an exception outside of the running threads context. As it stands now, this is completely OK behavior ( well, except of course the exception ) and we wired up AppDomain.CurrentDomain.UnhandledException to simply restart the program.

The only problem is, the [Your Program] has stopped working like the one below, appears: alt text

Is there a way to prevent this dialog from appearing at all, be it in the AppDomain unhandled exception handler or in a config setting, as no end users are going to be reading it and it just holds up resources until it is clicked.

© Stack Overflow or respective owner

Related posts about winforms

Related posts about exception